<%@ page contentType="text/html; charset=UTF-8" language="java" errorPage="/error.jsp"%>
<%@ page import="com.fredck.FCKeditor.*" %>
<%@ page import="com.beans.log.*"%> 
<%@ page import="com.business.log.*"%>
<%@ page import="java.util.List" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<script type="text/javascript">
function check()
{
       if(document.logform.title.value=="")
	   {
	          alert("标题不能为空");
			  document.logform.title.focus();
			  return false;
	   }
      	       
}
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="../images/css.css" rel="stylesheet" type="text/css">
<title>修改日志</title>
</head>

<body style="	font-size: 9pt;
	line-height: 150%;
	color: #000000;
	text-decoration: none;">
<%	
	String logNo=request.getParameter("no");
	LogListBus llb=new LogListBus();
	LogInfo li=llb.getLogByNo(logNo); 
%>

  <form id="logform" name="logform" method="post" action="<%=request.getContextPath() %>/managelog" onsubmit="return check()">
<label>日志类型:
  	
  	  <select name="logcategory"> 	
  	    <option value="0" <%if(li.getLogCategory().equals("0")){%> selected="selected"<%}%>>原创 </option>
  	    <option value="1" <%if(li.getLogCategory().equals("1")){%> selected="selected"<%}%>>转载</option>
  	    <option value="2" <%if(li.getLogCategory().equals("2")){%> selected="selected"<%}%>>翻译</option>
      </select> </label>&nbsp;&nbsp;
<label>日志分类
	<select name="logtypeid">
	<option value="0" >请选择分类</option>
	<%			LogTypeBus ltb=new LogTypeBus();
		List logTypeList=ltb.getAllLogTypes(li.getLogAuthor());
		for(int i=0;i<logTypeList.size();i++) {
		LogType lt=(LogType)logTypeList.get(i);
	%>
	<option value="<%=lt.getLogtypeId()%>" <%if(li.getLogtypeId().equals(lt.getLogtypeId())){%>selected<%}%>><%=lt.getLogtypeName()%></option>
	<%
		}
	%>
	</select>
	</label>

	<br />
	<br/>

    <label>标题：
    <input name="title" type="text"  value="<%=li.getLogTitle()%>" size="40"/>
    </label>
      <label><br />
      内容：
      <br />
      <%
FCKeditor oFCKeditor ;
oFCKeditor = new FCKeditor( request, "content" ) ;
oFCKeditor.setBasePath( request.getContextPath()+"/FCKeditor/" ) ;
oFCKeditor.setHeight( "500" ) ;
oFCKeditor.setValue(com.util.TextTools.html2txt(li.getLogContent()));
out.println( oFCKeditor.create() ) ;
%>
    </label>

	<br />

      <label>摘要：<br />
      <textarea name="intro" cols="50"><%=com.util.TextTools.html2txt(li.getLogIntro())%></textarea>
    </label>

    <br />

    <label>
     <input type="checkbox" name="isshow" value="1" <%if(li.getIsShow().equals("1")){%>checked="checked"<%}%>/>是否显示出来<br />
    </label>
    <label>
     <input type="checkbox" name="isquote" value="1" <%if(li.getIsQuote().equals("1")){%>checked="checked"<%}%> />
    是否推荐到系统首页<br />
</label>

      <label>Tag:(请增加一个或多个，用“，”分开）
     <input name="logtag" type="text" value="<%=li.getLogTag()%>" size="30"/>
      </label>

		<input type="hidden" name="log_quotenums" value="<%=li.getLogQuotenums()%>"/>
	   <input type="hidden" name="log_quote_id" value="<%=li.getLogQuoteId()%>"/>
		<input type="hidden" name="replynum" value="<%=li.getReplynum()%>"/>
		<input type="hidden" name="viewnums" value="<%=li.getViewnums()%>"/>
     <input type="hidden" name="logauthor" value="<%=li.getLogAuthor()%>"/>
	 <input type="hidden" name="logno" value="<%=logNo%>"/>

        <label>
		<br />
  <center> <input name="edit" type="submit" id="edit" value=" 编辑 "></center>
      </label>

  </form>
 
</div>
</body>
</html>
